# -*- coding:utf-8 -*-
from application import db
from application.utils.models import BaseModel


class Student(BaseModel, db.Model):
    __tablename__ = "tb_student"
    id = db.Column(db.Integer, primary_key=True, comment="主键ID")
    name = db.Column(db.String(250), comment="姓名")
    avatar = db.Column(db.String(250), comment="头像")
    age = db.Column(db.Integer, comment="年龄")
    sex = db.Column(db.Boolean, default=False,comment="性别")
    money = db.Column(db.DECIMAL(8, 2), nullable=True, comment="钱包")
    # achievement_list = db.relationship("Achievement", uselist=True, backref="student")
    # info = db.relationship("StudentInfo", backref="own", uselist=False)

    def __repr__(self):
        return self.name
